package cn.secby.orders.service.impl;
import cn.secby.common.core.web.mapper.WrapperParse;
import java.util.List;
import cn.secby.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.secby.orders.mapper.OrderItemMapper;
import cn.secby.orders.domain.OrderItem;
import cn.secby.orders.service.IOrderItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;

/**
 * 订单明细Service业务层处理
 * @author shenkunlin
 * @date 2025-05-06
 */
@Service
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements IOrderItemService
{
    @Autowired
    private OrderItemMapper orderItemMapper;

    /**
     * 查询订单明细
     * @param id 订单明细主键
     * @return 订单明细
     */
    @Override
    public OrderItem selectOrderItemById(Long id)
    {
        return getById(id);
    }

    /**
     * 查询订单明细列表
     * @param orderItem 订单明细
     * @return 订单明细
     */
    @Override
    public List<OrderItem> selectOrderItemList(OrderItem orderItem)
    {
        return list(WrapperParse.query(orderItem));
    }

    /**
     * 新增订单明细
     * @param orderItem 订单明细
     * @return 结果
     */
    @Override
    public Boolean insertOrderItem(OrderItem orderItem)
    {
        return save(orderItem);
    }

    /**
     * 修改订单明细
     * @param orderItem 订单明细
     * @return 结果
     */
    @Override
    public Boolean updateOrderItem(OrderItem orderItem)
    {
        return updateById(orderItem);
    }

    /**
     * 批量删除订单明细
     * @param ids 需要删除的订单明细主键
     * @return 结果
     */
    @Override
    public Boolean deleteOrderItemByIds(List<Long> ids)
    {
        return removeByIds(ids);
    }

    /**
     * 删除订单明细信息
     * @param id 订单明细主键
     * @return 结果
     */
    @Override
    public Boolean deleteOrderItemById(Long id)
    {
        return removeById(id);
    }
}
